﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Konstaller
{
   public class Button
    {

       //Private Field
       string tx = "Button";
       bool sel = false;


       /// <summary>
       /// Get or Set Text for Button
       /// </summary>
       public string Text
       {
           get { return tx; }
           set { tx = value; }
       }


       /// <summary>
       /// Get or Set if the Button are selected
       /// </summary>
       public bool Selected
       {
           get { return sel;}
           set { sel = value; }
       }



       /// <summary>
       /// Draw Method for Button Control
       /// </summary>
       /// <param name="x">Set X Position</param>
       /// <param name="y">Set Y Position</param>
       /// <param name="selected">Set if the button are Selected</param>
       public void Draw(int x, int y)
       {

           Console.SetCursorPosition(x, y);

           if (!Selected)
           {
               Console.BackgroundColor = ConsoleColor.Gray;
           }
           else
           {
               Console.BackgroundColor = ConsoleColor.DarkGreen;
           }


           Console.ForegroundColor = ConsoleColor.White;
           Console.Write("[ ");
           Console.ForegroundColor = ConsoleColor.Black;
           Console.Write(Text + " ");
           Console.ForegroundColor = ConsoleColor.DarkGray;
           Console.Write("]");

           Console.BackgroundColor = ConsoleColor.Gray;
           Console.ForegroundColor = ConsoleColor.Black;
       }



    }
}
